<?php

class Sistema_AnaliticsController extends App_Controller_Action
{

    private $_table     = 'SOBRE';
    private $_pk        = 'SOB_ID';
    private $_order_col = 'SOB_ID';
    private $_order     = 'ASC';
    private $_sta_col   = 'SOB_STA';
    private $obj        = '';
    private $form       = '';
    private $_file_col  = 'SOB_FILE'; 
    public  $dir = 'public/upload//';
    
    public function init()
    {
       
    }

    public function indexAction() {
       
        require_once 'library/gapi.class.php';
        
        try {
            
        
            $ga = new gapi('alenkar.k@gmail.com','dark274K');
            
            
            $ga->requestReportData(12750675,array('browser','browserVersion'),array('pageviews','visits'));
            exit();
            foreach($ga->getResults() as $result)
            {
              echo '<strong>'.$result.'</strong><br />';
              echo 'Pageviews: ' . $result->getPageviews() . ' ';
              echo 'Visits: ' . $result->getVisits() . '<br />';
            }

            echo '<p>Total pageviews: ' . $ga->getPageviews() . ' total visits: ' . $ga->getVisits() . '</p>';

        
        
        
        } catch (Exception $ex) {
            echo $ex->getMessage();
        }
    }
    
   
}